audio_form object

This method will edit text in an input box or status bar.

bool edit_text(int control_id, string new_text, int position, int edit_mode)

Parameters:
control_id
The control ID of the listbox.
new_text
The new text for the edited section.
position
The zero-based starting position for the edit.
edit_mode
One of the three available edit modes (see the text edit mode constants for further information).

Return value:
true on success, false on failure.

Remarks:
None.

Example:
// Make a simple form with an input box that edits when the change button is pressed.

#include "form.bgt"

audio_form form;

void main()
{
form.create_window("test",true);
int text=form.create_input_box("Type here", "This is a default text", "", 0, true, false);
int btn1=form.create_button("&Change",true,false);
int btn2=form.create_button("E&xit",false,true);
while(true)
{
form.monitor();
if(form.is_pressed(btn1))
{
form.edit_text(text, "document", 18, edit_mode_append_to_end);
}
if(form.is_pressed(btn2))
{
exit();
}
if((key_down(KEY_LMENU))&&(key_pressed(KEY_F4)))
{
exit();
}
wait(5);
}
}